package Month11.Day10;

import java.util.Arrays;
import java.util.Scanner;

public class T2 {
    public static void main(String[] args) {
        String a="zip";
        String b="rar";
        Scanner in=new Scanner(System.in);
        System.out.println("请输入你的作业名称（带压缩格式）");
        String work=in .next();
        String[] s= work.split("\\.");
        System.out.println(Arrays.toString(s));
        boolean geshi=false;
        for (int i=0;i<s.length;i++){
            System.out.println(s[i]);
            if (a.equals(s[i])||b.equals(s[i])){
                geshi=true;

            }
        }if (geshi){
            System.out.println("作业格式合适");
        }else {
            System.out.println("作业格式不合适，请重新输入！");
        }


    }
}
